# delimit ;
clear;
*version 12;
set matsize 400;
set more off;

log using "/Users/Jeff/Dropbox/TermLimits/Replication/Models/EstimatingModels.log", replace;

**************************************************************;
*Author: Jeff Carter                                         *;
*Date: Saturday, November 12, 2016                         *;
**************************************************************;

use "/Users/Jeff/Dropbox/TermLimits/Replication/Data/TermLimitsAnalysisData.dta", clear;





** Primary Unconditional Analyses **;

logit cwinit lameduck hawkish  rivalry numbord parliament gender peace peace2 peace3   ,  robust;
preserve;

drawnorm MG_b1-MG_b10, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexEmpirical/Unconditional/Primary/SimData.dta", replace;

restore;


logit cwinit lameduck hawkish2  rivalry numbord parliament gender peace peace2 peace3   ,  robust;
preserve;

drawnorm MG_b1-MG_b10, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexTheoretical/Unconditional/Primary/SimData.dta", replace;

restore;


logit cwinit lameduck milservice  rivalry numbord parliament gender peace peace2 peace3   ,  robust;
preserve;

drawnorm MG_b1-MG_b10, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/Military/Unconditional/Primary/SimData.dta", replace;

restore;



*** Additional Controls  ***;

logit cwinit lameduck hawkish   rivalry numbord parliament gender civwar  rgdppc gdpgrowthpct majpow mm peace peace2 peace3   ,  robust;
preserve;

drawnorm MG_b1-MG_b15, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexEmpirical/Unconditional/AdditionalControls/SimData.dta", replace;

restore;





logit cwinit lameduck hawkish2   rivalry numbord parliament gender civwar  rgdppc gdpgrowthpct majpow mm peace peace2 peace3   ,  robust;
preserve;

drawnorm MG_b1-MG_b15, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexTheoretical/Unconditional/AdditionalControls/SimData.dta", replace;

restore;




logit cwinit lameduck milservice   rivalry numbord parliament gender civwar  rgdppc gdpgrowthpct majpow mm peace peace2 peace3   ,  robust;
preserve;

drawnorm MG_b1-MG_b15, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/Military/Unconditional/AdditionalControls/SimData.dta", replace;

restore;




*** Conflict Severity  ***;

gen wardv2 = 0;
replace wardv2 = 1 if cwinit == 1 & wardv == 0;
replace wardv2 = 2 if wardv == 1;

ologit wardv2 lameduck hawkish   rivalry numbord parliament gender  peace peace2 peace3   ,  robust;
preserve;

drawnorm MG_b1-MG_b11, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexEmpirical/Unconditional/Severity/SimData.dta", replace;

restore;


ologit wardv2 lameduck hawkish2   rivalry numbord parliament gender  peace peace2 peace3   ,  robust;
preserve;

drawnorm MG_b1-MG_b11, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexTheoretical/Unconditional/Severity/SimData.dta", replace;

restore;



ologit wardv2 lameduck milservice   rivalry numbord parliament gender  peace peace2 peace3   ,  robust;
preserve;

drawnorm MG_b1-MG_b11, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/Military/Unconditional/Severity/SimData.dta", replace;

restore;




*** Single vs. Multiple Mandates  ***;

logit cwinit  lameduckone lameducktwo hawkish  rivalry numbord parliament gender peace peace2 peace3 ,  robust;
preserve;

drawnorm MG_b1-MG_b11, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexTheoretical/Unconditional/Mandates/SimData.dta", replace;

restore;




logit cwinit  lameduckone lameducktwo hawkish2  rivalry numbord parliament gender peace peace2 peace3 ,  robust;
preserve;

drawnorm MG_b1-MG_b11, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexEmpirical/Unconditional/Mandates/SimData.dta", replace;

restore;



logit cwinit  lameduckone lameducktwo milservice  rivalry numbord parliament gender peace peace2 peace3 ,  robust;
preserve;

drawnorm MG_b1-MG_b11, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/Military/Unconditional/Mandates/SimData.dta", replace;

restore;





*** Time Trend  ***;

logit cwinit lameduck hawkish  rivalry numbord parliament gender peace peace2 peace3 year  ,  robust;
preserve;

drawnorm MG_b1-MG_b11, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexTheoretical/Unconditional/TimeTrend/SimData.dta", replace;

restore;



logit cwinit lameduck hawkish2  rivalry numbord parliament gender peace peace2 peace3 year  ,  robust;
preserve;

drawnorm MG_b1-MG_b11, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexEmpirical/Unconditional/TimeTrend/SimData.dta", replace;

restore;



logit cwinit lameduck milservice  rivalry numbord parliament gender peace peace2 peace3 year  ,  robust;
preserve;

drawnorm MG_b1-MG_b11, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/Military/Unconditional/TimeTrend/SimData.dta", replace;

restore;





*** Year Fixed Effects  ***;

clogit cwinit lameduck hawkish  rivalry numbord parliament gender peace peace2 peace3 , robust   group(year);
preserve;

drawnorm MG_b1-MG_b9, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexTheoretical/Unconditional/Year/SimData.dta", replace;

restore;


clogit cwinit lameduck hawkish2  rivalry numbord parliament gender peace peace2 peace3 , robust   group(year);
preserve;

drawnorm MG_b1-MG_b9, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexEmpirical/Unconditional/Year/SimData.dta", replace;

restore;


clogit cwinit lameduck milservice  rivalry numbord parliament gender peace peace2 peace3 , robust   group(year);
preserve;

drawnorm MG_b1-MG_b9, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/Military/Unconditional/Year/SimData.dta", replace;

restore;





*** Decade Fixed Effects  ***;

clogit cwinit lameduck hawkish  rivalry numbord parliament gender peace peace2 peace3 , robust   group(decade);
preserve;

drawnorm MG_b1-MG_b9, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexTheoretical/Unconditional/Decade/SimData.dta", replace;

restore;


clogit cwinit lameduck hawkish2  rivalry numbord parliament gender peace peace2 peace3 , robust   group(decade);
preserve;

drawnorm MG_b1-MG_b9, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexEmpirical/Unconditional/Decade/SimData.dta", replace;

restore;



clogit cwinit lameduck milservice  rivalry numbord parliament gender peace peace2 peace3 , robust   group(decade);
preserve;

drawnorm MG_b1-MG_b9, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/Military/Unconditional/Decade/SimData.dta", replace;

restore;




*** Regional Fixed Effects  ***;

clogit cwinit lameduck hawkish rivalry numbord parliament gender peace peace2 peace3 ,  group(region);
preserve;

drawnorm MG_b1-MG_b9, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexTheoretical/Unconditional/Region/SimData.dta", replace;

restore;



clogit cwinit lameduck hawkish2 rivalry numbord parliament gender peace peace2 peace3 ,  group(region);
preserve;

drawnorm MG_b1-MG_b9, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexEmpirical/Unconditional/Region/SimData.dta", replace;

restore;



clogit cwinit lameduck milservice rivalry numbord parliament gender peace peace2 peace3 ,  group(region);
preserve;

drawnorm MG_b1-MG_b9, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/Military/Unconditional/Region/SimData.dta", replace;

restore;




*** Variation in Military Service  ***;

logit cwinit  lameduck  combat milnoncombat  rivalry numbord parliament gender peace peace2 peace3  ,  robust;
estimates store combatmodel;

preserve;

drawnorm MG_b1-MG_b11, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/Military/Unconditional/ServiceType/SimData.dta", replace;

restore;




logit cwinit  lameduck militarycareer  milnoncareer  rivalry numbord parliament gender peace peace2 peace3  ,  robust;
preserve;

drawnorm MG_b1-MG_b11, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/Military/Unconditional/MilitaryCareer/SimData.dta", replace;

restore;








** Primary Conditional Analyses **;

logit cwinit lameduck hawkish lameduck_hawkish rivalry numbord parliament gender peace peace2 peace3   ,  robust;
preserve;

drawnorm MG_b1-MG_b11, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexEmpirical/Conditional/Primary/SimData.dta", replace;

restore;




logit cwinit lameduck hawkish2 lameduck_hawkish2 rivalry numbord parliament gender peace peace2 peace3   ,  robust;
preserve;

drawnorm MG_b1-MG_b11, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexTheoretical/Conditional/Primary/SimData.dta", replace;

restore;





logit cwinit lameduck milservice lameduck_mil rivalry numbord parliament gender peace peace2 peace3   ,  robust;
preserve;

drawnorm MG_b1-MG_b11, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/Military/Conditional/Primary/SimData.dta", replace;

restore;





*** Additional Control Variables  ***;

logit cwinit lameduck hawkish lameduck_hawkish   rivalry numbord parliament gender civwar  rgdppc gdpgrowthpct majpow mm peace peace2 peace3   ,  robust;
preserve;

drawnorm MG_b1-MG_b16, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexEmpirical/Conditional/AdditionalControls/SimData.dta", replace;

restore;


logit cwinit lameduck hawkish2 lameduck_hawkish2   rivalry numbord parliament gender civwar  rgdppc gdpgrowthpct majpow mm peace peace2 peace3   ,  robust;
preserve;

drawnorm MG_b1-MG_b16, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexTheoretical/Conditional/AdditionalControls/SimData.dta", replace;

restore;




logit cwinit lameduck milservice lameduck_mil   rivalry numbord parliament gender civwar  rgdppc gdpgrowthpct majpow mm peace peace2 peace3   ,  robust;
preserve;

drawnorm MG_b1-MG_b16, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/Military/Conditional/AdditionalControls/SimData.dta", replace;

restore;




*** Conflict Severity  ***;

ologit wardv2 lameduck hawkish lameduck_hawkish   rivalry numbord parliament gender peace peace2 peace3   ,  robust;
preserve;

drawnorm MG_b1-MG_b12, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexEmpirical/Conditional/Severity/SimData.dta", replace;

restore;



ologit wardv2 lameduck hawkish2 lameduck_hawkish2   rivalry numbord parliament gender peace peace2 peace3   ,  robust;
preserve;

drawnorm MG_b1-MG_b12, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexTheoretical/Conditional/Severity/SimData.dta", replace;

restore;




ologit wardv2 lameduck milservice lameduck_mil   rivalry numbord parliament gender  peace peace2 peace3   ,  robust;
preserve;

drawnorm MG_b1-MG_b12, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/Military/Conditional/Severity/SimData.dta", replace;

restore;





*** Single vs. Multiple Mandates  ***;

logit cwinit  lameduckone hawkish lameduckone_hawkish lameducktwo lameducktwo_hawkish rivalry numbord parliament gender peace peace2 peace3 ,  robust;
preserve;

drawnorm MG_b1-MG_b13, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexEmpirical/Conditional/Mandates/SimData.dta", replace;

restore;



logit cwinit  lameduckone hawkish2 lameduckone_hawkish2 lameducktwo lameducktwo_hawkish2 rivalry numbord parliament gender peace peace2 peace3 ,  robust;
preserve;

drawnorm MG_b1-MG_b13, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexTheoretical/Conditional/Mandates/SimData.dta", replace;

restore;


logit cwinit  lameduckone milservice lameduckone_mil lameducktwo lameducktwo_mil rivalry numbord parliament gender peace peace2 peace3 ,  robust;
preserve;

drawnorm MG_b1-MG_b13, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/Military/Conditional/Mandates/SimData.dta", replace;

restore;



*** Time Trend  ***;

logit cwinit lameduck hawkish lameduck_hawkish  rivalry numbord parliament gender peace peace2 peace3 year  ,  robust;
preserve;

drawnorm MG_b1-MG_b12, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexEmpirical/Conditional/TimeTrend/SimData.dta", replace;

restore;




logit cwinit lameduck hawkish2 lameduck_hawkish2  rivalry numbord parliament gender peace peace2 peace3 year  ,  robust;
preserve;

drawnorm MG_b1-MG_b12, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexTheoretical/Conditional/TimeTrend/SimData.dta", replace;

restore;



logit cwinit lameduck milservice lameduck_mil  rivalry numbord parliament gender peace peace2 peace3 year  ,  robust;
preserve;

drawnorm MG_b1-MG_b12, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/Military/Conditional/TimeTrend/SimData.dta", replace;

restore;




*** Year Fixed Effects  ***;

clogit cwinit lameduck hawkish lameduck_hawkish  rivalry numbord parliament gender peace peace2 peace3 , robust   group(year);
preserve;

drawnorm MG_b1-MG_b10, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexEmpirical/Conditional/Year/SimData.dta", replace;

restore;





clogit cwinit lameduck hawkish2 lameduck_hawkish2  rivalry numbord parliament gender peace peace2 peace3 , robust   group(year);
preserve;

drawnorm MG_b1-MG_b10, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexTheoretical/Conditional/Year/SimData.dta", replace;

restore;




clogit cwinit lameduck milservice lameduck_mil  rivalry numbord parliament gender peace peace2 peace3 , robust   group(year);
preserve;

drawnorm MG_b1-MG_b10, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/Military/Conditional/Year/SimData.dta", replace;

restore;



*** Decade Fixed Effects  ***;

clogit cwinit lameduck hawkish lameduck_hawkish  rivalry numbord parliament gender peace peace2 peace3 , robust   group(decade);
preserve;

drawnorm MG_b1-MG_b10, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexEmpirical/Conditional/Decade/SimData.dta", replace;

restore;



clogit cwinit lameduck hawkish2 lameduck_hawkish2  rivalry numbord parliament gender peace peace2 peace3 , robust   group(decade);
preserve;

drawnorm MG_b1-MG_b10, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexTheoretical/Conditional/Decade/SimData.dta", replace;

restore;



clogit cwinit lameduck milservice lameduck_mil  rivalry numbord parliament gender peace peace2 peace3 , robust   group(decade);
preserve;

drawnorm MG_b1-MG_b10, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/Military/Conditional/Decade/SimData.dta", replace;

restore;



*** Regional Fixed Effects  ***;

clogit cwinit lameduck hawkish lameduck_hawkish rivalry numbord parliament gender peace peace2 peace3 ,  group(region);
preserve;

drawnorm MG_b1-MG_b10, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexEmpirical/Conditional/Region/SimData.dta", replace;

restore;


clogit cwinit lameduck hawkish2 lameduck_hawkish2 rivalry numbord parliament gender peace peace2 peace3 ,  group(region);
preserve;

drawnorm MG_b1-MG_b10, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/IndexTheoretical/Conditional/Region/SimData.dta", replace;

restore;



clogit cwinit lameduck milservice lameduck_mil rivalry numbord parliament gender peace peace2 peace3 ,  group(region);
preserve;

drawnorm MG_b1-MG_b10, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/Military/Conditional/Region/SimData.dta", replace;

restore;



*** Variation in Military Service  ***;

logit cwinit  lameduck milnoncombat  lameduck_noncombat combat  lameduck_combat rivalry numbord parliament gender peace peace2 peace3  ,  robust;
preserve;

drawnorm MG_b1-MG_b13, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/Military/Conditional/ServiceType/SimData.dta", replace;

restore;



logit cwinit  lameduck militarycareer lameduck_milcareer milnoncareer lameduck_milnoncareer  rivalry numbord parliament gender peace peace2 peace3  ,  robust;
preserve;

drawnorm MG_b1-MG_b13, n(10000) means(e(b)) cov(e(V)) clear;

save "/Users/Jeff/Dropbox/TermLimits/Replication/Models/Military/Conditional/MilitaryCareer/SimData.dta", replace;

restore;









log close;
